<%--
  Created by IntelliJ IDEA.
  User: 星云
  Date: 2019/3/19
  Time: 17:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form action="StudentServlet?flag=${choice}&id=${student.id}" method="post">
    <p>姓名:<input type="text" id="name" name="name" value="${student.name}"/></p>
    <p>性别:

        <input type="radio" name="sex" value="男" <c:if test="${student.sex=='男'}">checked="checked"</c:if>/>男
        <input type="radio" name="sex" value="女" <c:if test="${student.sex=='女'}">checked="checked"</c:if>/>女
    </p>
    <p>年级:
        <!-- 这里不能写死  必须从数据库查出来 -->
        <select id="grade" name="grade">
            <c:forEach items="${grades}" var="i">
                <option value="${i.gradeId}"
                        <c:if test="${student.gradeId==i.gradeId}">selected="selected"</c:if>>${i.gradeName}
                </option>
            </c:forEach>
        </select>
    </p>
    <input type="submit" value="${choice}"/>
</form>
</body>
</html>
